import axios from 'axios'
import store from '../store'
const request = axios.create({
  baseURL: 'http://www.liulongbin.top:3008'
})
// 请求拦截器
request.interceptors.request.use(
  function (config) {
    if (config.url.startsWith('/my/')) {
      config.headers.Authorization = store.state.user.token
    }
    return config
  },
  function (error) {
    return Promise.reject(error)
  }
)
export default request
